package com.mfl.controller.user;

import com.mfl.common.Result;
import com.mfl.pojo.dto.ExamDTO;
import com.mfl.service.ExamService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("userExamController")
@RequestMapping("/cky/user/exam")
@Slf4j
public class ExamController {

    @Autowired
    private ExamService examService;

    /**
     * 添加考试记录
     * @param examDTO
     * @return
     */
    @PostMapping("/insert")
   public Result insert(@RequestBody ExamDTO examDTO){
        log.info("添加考试记录：{}", examDTO);
        examService.insert(examDTO);
        return Result.success("提交成功，请前往考试记录查看");
   }
}
